
package com.superc.lib.intent;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.superc.R;
import com.superc.lib.helper.KeyValue;
import com.superc.lib.ui.UIFunction;

public class MulitAddSelector extends Activity {

	public static final String BUNDEL_NAME = "param";
	private Activity my = null;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.multiselectaddview);
		my=this;
		UIFunction.getButton(my,R.id.cmdMSAddViewSave).setOnClickListener(btnClick);
	}


	private View.OnClickListener btnClick = new View.OnClickListener() {
		public void onClick(View v) {
			switch (v.getId()) {
				case R.id.cmdMSAddViewSave:{
					Intent resultIntent = new Intent();
					String newValue=UIFunction.getEditText(my, R.id.txtMSAddViewValue).getText().toString();
					resultIntent.putExtra(MulitAddSelector.BUNDEL_NAME,
							new KeyValue<String,String>(newValue,newValue));
					setResult(RESULT_OK, resultIntent);
					finish();
					break;
				}
			}
		}
	};

}